package com.ruoyi.am.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.am.mapper.AmDriverMapper;
import com.ruoyi.am.domain.AmDriver;
import com.ruoyi.am.service.IAmDriverService;
import com.ruoyi.common.core.text.Convert;

/**
 * 司机信息Service业务层处理
 * 
 * @author hkkk
 * @date 2020-12-19
 */
@Service
public class AmDriverServiceImpl implements IAmDriverService 
{
    @Autowired
    private AmDriverMapper amDriverMapper;

    /**
     * 查询司机信息
     * 
     * @param driverId 司机信息ID
     * @return 司机信息
     */
    @Override
    public AmDriver selectAmDriverById(Long driverId)
    {
        return amDriverMapper.selectAmDriverById(driverId);
    }

    /**
     * 查询司机信息列表
     * 
     * @param amDriver 司机信息
     * @return 司机信息
     */
    @Override
    public List<AmDriver> selectAmDriverList(AmDriver amDriver)
    {
        return amDriverMapper.selectAmDriverList(amDriver);
    }

    /**
     * 新增司机信息
     * 
     * @param amDriver 司机信息
     * @return 结果
     */
    @Override
    public int insertAmDriver(AmDriver amDriver)
    {
        amDriver.setCreateTime(DateUtils.getNowDate());
        return amDriverMapper.insertAmDriver(amDriver);
    }

    /**
     * 修改司机信息
     * 
     * @param amDriver 司机信息
     * @return 结果
     */
    @Override
    public int updateAmDriver(AmDriver amDriver)
    {
        return amDriverMapper.updateAmDriver(amDriver);
    }

    /**
     * 删除司机信息对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteAmDriverByIds(String ids)
    {
        return amDriverMapper.deleteAmDriverByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除司机信息信息
     * 
     * @param driverId 司机信息ID
     * @return 结果
     */
    @Override
    public int deleteAmDriverById(Long driverId)
    {
        return amDriverMapper.deleteAmDriverById(driverId);
    }

    @Override
    public AmDriver selectAmDriverByNum(String driverNum){
        return amDriverMapper.selectAmDriverByNum(driverNum);
    }


}
